package com.platform.common.core.constant;

/**
 * 缓存常量信息
 *
 * @author
 */
public class CacheConstants {
    /**
     * 缓存有效期，默认180（分钟）
     */
    public final static long EXPIRATION = 180;

    /**
     * 缓存刷新时间，默认30（分钟）
     */
    public final static long REFRESH_TIME = 30;

    /**
     * 密码最大错误次数
     */
    public final static int PASSWORD_MAX_RETRY_COUNT = 5;

    /**
     * 密码锁定时间，默认10（分钟）
     */
    public final static long PASSWORD_LOCK_TIME = 10;

    public final static long PHONECODE_TIME = 1;


    /**
     * 权限缓存前缀
     */
    public final static String LOGIN_TOKEN_KEY = "login_tokens:";
    /**
     * 数据权限缓存前缀
     */
    public final static String DATA_PERMISSION_KEY = "data_permission:";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 参数管理 cache key
     */
    public static final String SYS_CONFIG_KEY = "sys_config:";

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

    /**
     * 登录账户密码错误次数 redis key
     */
    public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";

    /**
     * 登录IP黑名单 cache key
     */
    public static final String SYS_LOGIN_BLACKIPLIST = SYS_CONFIG_KEY + "sys.login.blackIPList";

    /**
     * 外部应用登录缓存前缀
     */
    public final static String APP_TOKEN_KEY = "app_login_tokens:";

    /**
     * 应用-接口缓存前缀
     */
    public final static String APP_API_KEY = "app_api_key:";
    /**
     * 应用-加密工具缓存前缀
     */
    public final static String API_SEC_KEY = "api_secret_key:";
    /**
     * 所有接口 缓存前缀
     */
    public final static String API_ALL_KEY = "api_all_key:";
    /**
     * 所有机号 缓存前缀
     */
    public final static String FLIGHT_NUM_KEY = "flight_num_key:";

    /**
     * 手机验证码 key
     *
     * @author chx
     * @date 14:11 2022/11/22
     **/
    public static final String PHONE_CAPTCHA_CODE_KEY = "phone_captcha_codes:";

    //redis目录保存在线用户
    public static final String WATCH_ONLINE_DIR = "watch_online:";
    public static final String APP_ONLINE_DIR = "app_online:";
    public static final String SPECTACLES_ONLINE_DIR = "spectacles_online:";
    public static final String WCHAT_ONLINE_DIR = "wchat_online:";

    /**
     * 货站基础数据缓存key
     */
    public static final String CARGO_TERMINAL_CACHE_KEY = "cargo_terminal_cache_key";

    /**
     * 仓库基础数据缓存key
     */
    public static final String WAREHOUSE_CACHE_KEY = "warehouse_cache_key";

    /**
     * 库区基础数据缓存key
     */
    public static final String STORAGE_AREA_CACHE_KEY = "storage_area_cache_key";

    /**
     * 库位基础数据缓存key
     */
    public static final String STORAGE_LOCATION_CACHE_KEY = "storage_location_cache_key";

    /**
     * 分隔符
     */
    public static final String SEPARATOR = "|";
}
